# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: leon

from coin.exchange.base.kr_rest.product_info import ProductInfo, ProductHolder
from coin.exchange.fcoin.kr_rest.product import FcoinProduct
from coin.exchange.fcoin.kr_rest.constants import product_precision


def get_holder_from_product(product):
  assert isinstance(product, FcoinProduct)
  price_precision, qty_precision = product_precision[product.native_symbol]
  product_info = ProductInfo(price_precision=price_precision, qty_precision=qty_precision)

  return ProductHolder(product, product_info)
